//
//  CXFisrtActionColelctionCell.m
//  ProjectOfBStage
//
//  Created by cuixin on 15/11/13.
//  Copyright © 2015年 cuixin. All rights reserved.
//

#import "CXFisrtActionColelctionCell.h"
#import <SDWebImageManager.h>
#import <UIImageView+WebCache.h>
@implementation CXFisrtActionColelctionCell

-(void)dealloc{
    [_imgView release];
    [_backView release];
    [_titleLable release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.imgView = [[UIImageView alloc] init];
        self.backView = [[UIView alloc] init];
        self.titleLable = [[UILabel alloc] init];
        self.downLable = [[UILabel alloc]init];
        
        self.backView.backgroundColor = [UIColor blackColor];
        self.backView.alpha = 0.5;
        [self.titleLable setTextColor:[UIColor whiteColor]];
        self.imgView.backgroundColor = [UIColor orangeColor];
        [self.contentView addSubview:self.imgView];
        [self.backView addSubview:self.titleLable];
        [self.imgView addSubview:self.backView];
        
        [_imgView release];
        [_backView release];
        [_titleLable release];

    }
    return self;
}
-(void)layoutSubviews{
    [super layoutSubviews];
        self.imgView.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height );
        self.backView.frame = CGRectMake(0, self.imgView.frame.size.height - HEIGHT_PRO(30), self.imgView.frame.size.width, HEIGHT_PRO(30))
        ;
        self.titleLable.frame = CGRectMake(0, 0, self.imgView.frame.size.width, HEIGHT_PRO(30));
}

-(void)setFisrtModel:(CXInterActionFirstModel *)fisrtModel{
    if (_fisrtModel != fisrtModel) {
        [_fisrtModel release];
        _fisrtModel = [fisrtModel retain];
    }
    [self.imgView sd_setImageWithURL:[NSURL URLWithString:fisrtModel.pic] placeholderImage:[UIImage imageNamed:@"wait.png"]];
    self.titleLable.text = fisrtModel.name;

}

@end
